package com.copm.ifm.servers.sys.mapper.type;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.copm.ifm.servers.sys.entity.SysLocationType;
import com.copm.ifm.servers.sys.vo.SysLocationTypeVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 位置分类表 Mapper 接口
 * </p>
 *
 * @author tp
 * @since 2020-12-30
 */
public interface SysLocationTypeMapper extends BaseMapper<SysLocationType> {

    List<SysLocationType> getLocaTypeTree(@Param("tenantId") int tenantId, @Param("projId") int projId, @Param("enabled") int enabled);

    SysLocationTypeVO selectParentLoaById(@Param("parentLoId") Integer parentLoId);

    Integer selectMaxSeq(@Param("tenantId") int tenantId, @Param("projId") int projId, @Param("level") int level);

    SysLocationType checkEquCode(@Param("tenantId") int tenantId, @Param("projId") int projId, @Param("code") String code);

    SysLocationType checkEquName(@Param("tenantId") int tenantId, @Param("projId") int projId, @Param("name") String name);

    String selectMaxPath(@Param("tenantId") int tenantId, @Param("projId") int projId, @Param("parentPath") String parentPath);

    int updateLeafNode(SysLocationType temp);

    List<SysLocationType> selectLocationTypebyName(@Param("tenantId") Long tenantId, @Param("projectId") Integer projectId, @Param("name") String name, @Param("parentPath") String parentPath);

    List<SysLocationType> selectLocationTypebyLevel(@Param("tenantId") Long tenantId, @Param("projectId") Integer projectId, @Param("name") String name, @Param("level") Integer level);

    SysLocationType selectHaveChild(Long tenantId, Integer projectId, String path);

    SysLocationType selectLocationTypeNotEnable(Long tenantId, Integer projectId, String path);

    SysLocationType selectLocationTypeByParentpath(Long tenantId, Integer projectId, String parentPath);

}
